#ifndef _AT24CXX_H
#define _AT24CXX_H

#include "system.h"
#include "iic.h"


#define AT24C01		127
#define AT24C02		255
#define AT24C04		511
#define AT24C08		1023
#define AT24C16		2047
#define AT24C32		4095
#define AT24C64	    8191
#define AT24C128	16383
#define AT24C256	32767  

//???????24c02,????EE_TYPE?AT24C02
#define EE_TYPE AT24C02

//u8 AT24CXX_ReadOneByte(u16 ReadAddr);							//??????????
//void AT24CXX_WriteOneByte(u16 WriteAddr,u8 DataToWrite);		//??????????
//void AT24CXX_WriteLenByte(u16 WriteAddr,u32 DataToWrite,u8 Len);//???????????????
//u32 AT24CXX_ReadLenByte(u16 ReadAddr,u8 Len);					//??????????????
//void AT24CXX_Write(u16 WriteAddr,u8 *pBuffer,u16 NumToWrite);	//????????????????
//void AT24CXX_Read(u16 ReadAddr,u8 *pBuffer,u16 NumToRead);   	//????????????????

//u8 AT24CXX_Check(void);  //????
//void AT24CXX_Init(void); //???IIC

u8 AT24CXX_Check(void);
void AT24CXX_Write(u16 WriteAddr,u8 *pBuffer,u16 NumWrite);
void AT24CXX_Read(u16 ReadAddr,u8 *pBuffer,u16 NumRead);
u32 AT24CXX_Read_Len(u16 ReadAddr,u8 Len);
void AT24CXX_Write_Len(u16 WriteAddr,u32 Data,u8 Len);
void AT24CXX_WriteByte(u16 WriteAddr,u8 Data);
u8 AT24CXX_ReadByte(u16 ReadAddr);
void AT24CXX_Init(void);
	
#endif
